package co.fitstart.entity.report;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.demo2do.core.format.DecimalFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import co.fitstart.entity.course.Course;
import co.fitstart.entity.course.schedule.CourseSchedule;
import co.fitstart.entity.site.Site;

/**
 * 
 * @author dan
 *
 */
@Entity
@Table(name = "finished_course_report")
@JsonIgnoreProperties(value={"hibernate_lazy_initializer","handler","fieldHandler"})
public class FinishedCourseReport {
    
    @Id
    @GeneratedValue
    private Long id;
    
    /** 金额 */
    @DecimalFormat
    private int offer;
    
    /** 学员名称 */
    private String studentName;
    
    /** 学员电话 */
    private String studentMobile;
    
    /** 教练姓名 */
    private String coachName;
    
    /** 签到时间 */
    private Date occurTime;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private Course course;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private Site site;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    private CourseSchedule courseSchedule;
    
    @Column(name = "is_disabled")
    private boolean disabled;
    
    /**
     * The default constructor
     */
    public FinishedCourseReport() {
        
    }
    
    /**
     * 
     * @param courseSchedule
     * @param offer
     */
    public FinishedCourseReport(CourseSchedule courseSchedule, Date occurTime, int offer) {
        this.offer = offer;
        this.studentName = courseSchedule.getStudent().getName();
        this.studentMobile = courseSchedule.getStudent().getMobile();
        this.coachName = courseSchedule.getCoach().getName();
        this.occurTime = occurTime;
        this.course = courseSchedule.getCourse();
        this.site = courseSchedule.getSite();
        this.courseSchedule = courseSchedule;
        this.disabled = false;
    }
    
    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the offer
     */
    public int getOffer() {
        return offer;
    }

    /**
     * @return the studentName
     */
    public String getStudentName() {
        return studentName;
    }

    /**
     * @return the studentMobile
     */
    public String getStudentMobile() {
        return studentMobile;
    }

    /**
     * @return the coachName
     */
    public String getCoachName() {
        return coachName;
    }

    /**
     * @return the signinTime
     */
    public Date getOccurTime() {
        return occurTime;
    }

    /**
     * @return the course
     */
    public Course getCourse() {
        return course;
    }

    /**
     * @return the site
     */
    public Site getSite() {
        return site;
    }

    /**
     * @return the courseSchedule
     */
    public CourseSchedule getCourseSchedule() {
        return courseSchedule;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param offer the offer to set
     */
    public void setOffer(int offer) {
        this.offer = offer;
    }

    /**
     * @param studentName the studentName to set
     */
    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    /**
     * @param studentMobile the studentMobile to set
     */
    public void setStudentMobile(String studentMobile) {
        this.studentMobile = studentMobile;
    }

    /**
     * @param coachName the coachName to set
     */
    public void setCoachName(String coachName) {
        this.coachName = coachName;
    }

    /**
     * @param signinTime the signinTime to set
     */
    public void setOccurTime(Date signinTime) {
        this.occurTime = signinTime;
    }

    /**
     * @param course the course to set
     */
    public void setCourse(Course course) {
        this.course = course;
    }

    /**
     * @param site the site to set
     */
    public void setSite(Site site) {
        this.site = site;
    }

    /**
     * @param courseSchedule the courseSchedule to set
     */
    public void setCourseSchedule(CourseSchedule courseSchedule) {
        this.courseSchedule = courseSchedule;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

}
